.class public Lcom/openfeint/api/resource/Leaderboard;
.super Lcom/openfeint/internal/resource/Resource;
.source "Leaderboard.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/openfeint/api/resource/Leaderboard$GetScoresCB;,
        Lcom/openfeint/api/resource/Leaderboard$GetUserScoreCB;,
        Lcom/openfeint/api/resource/Leaderboard$ListCB;
    }
.end annotation


# instance fields
.field public allowsWorseScores:Z

.field public descendingSortOrder:Z

.field public highScores:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/openfeint/api/resource/Score;",
            ">;"
        }
    .end annotation
.end field

.field public localUserScore:Lcom/openfeint/api/resource/Score;

.field public name:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 270
    invoke-direct {p0}, Lcom/openfeint/internal/resource/Resource;-><init>()V

    .line 52
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/openfeint/api/resource/Leaderboard;->descendingSortOrder:Z

    .line 270
    return-void
.end method

.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "resourceID"

    .prologue
    .line 37
    invoke-direct {p0}, Lcom/openfeint/internal/resource/Resource;-><init>()V

    .line 52
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/openfeint/api/resource/Leaderboard;->descendingSortOrder:Z

    .line 37
    invoke-virtual {p0, p1}, Lcom/openfeint/api/resource/Leaderboard;->setResourceID(Ljava/lang/String;)V

    return-void
.end method

.method public static getResourceClass()Lcom/openfeint/internal/resource/ResourceClass;
    .locals 5

    .prologue
    .line 276
    new-instance v0, Lcom/openfeint/api/resource/Leaderboard$4;

    const-class v1, Lcom/openfeint/api/resource/Leaderboard;

    const-string v2, "leaderboard"

    invoke-direct {v0, v1, v2}, Lcom/openfeint/api/resource/Leaderboard$4;-><init>(Ljava/lang/Class;Ljava/lang/String;)V

    .line 278
    .local v0, klass:Lcom/openfeint/internal/resource/ResourceClass;
    iget-object v1, v0, Lcom/openfeint/internal/resource/ResourceClass;->mProperties:Ljava/util/HashMap;

    const-string v2, "name"

    new-instance v3, Lcom/openfeint/api/resource/Leaderboard$5;

    invoke-direct {v3}, Lcom/openfeint/api/resource/Leaderboard$5;-><init>()V

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 279
    iget-object v1, v0, Lcom/openfeint/internal/resource/ResourceClass;->mProperties:Ljava/util/HashMap;

    const-string v2, "current_user_high_score"

    new-instance v3, Lcom/openfeint/api/resource/Leaderboard$6;

    const-class v4, Lcom/openfeint/api/resource/Score;

    invoke-direct {v3, v4}, Lcom/openfeint/api/resource/Leaderboard$6;-><init>(Ljava/lang/Class;)V

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 280
    iget-object v1, v0, Lcom/openfeint/internal/resource/ResourceClass;->mProperties:Ljava/util/HashMap;

    const-string v2, "descending_sort_order"

    new-instance v3, Lcom/openfeint/api/resource/Leaderboard$7;

    invoke-direct {v3}, Lcom/openfeint/api/resource/Leaderboard$7;-><init>()V

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 281
    iget-object v1, v0, Lcom/openfeint/internal/resource/ResourceClass;->mProperties:Ljava/util/HashMap;

    const-string v2, "allow_posting_lower_scores"

    new-instance v3, Lcom/openfeint/api/resource/Leaderboard$8;

    invoke-direct {v3}, Lcom/openfeint/api/resource/Leaderboard$8;-><init>()V

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 282
    iget-object v1, v0, Lcom/openfeint/internal/resource/ResourceClass;->mProperties:Ljava/util/HashMap;

    const-string v2, "high_scores"

    new-instance v3, Lcom/openfeint/api/resource/Leaderboard$9;

    const-class v4, Lcom/openfeint/api/resource/Score;

    invoke-direct {v3, v4}, Lcom/openfeint/api/resource/Leaderboard$9;-><init>(Ljava/lang/Class;)V

    invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 284
    return-object v0
.end method

.method private getScores(ZLcom/openfeint/api/resource/Leaderboard$GetScoresCB;)V
    .locals 6
    .parameter "friends"
    .parameter "cb"

    .prologue
    .line 94
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v3, "/xp/games/"

    invoke-direct {v1, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {}, Lcom/openfeint/internal/OpenFeintInternal;->getInstance()Lcom/openfeint/internal/OpenFeintInternal;

    move-result-object v3

    invoke-virtual {v3}, Lcom/openfeint/internal/OpenFeintInternal;->getAppID()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v3, "/leaderboards/"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/openfeint/api/resource/Leaderboard;->resourceID()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v3, "/high_scores"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    .line 95
    .local v4, path:Ljava/lang/String;
    new-instance v2, Lcom/openfeint/internal/request/OrderedArgList;

    invoke-direct {v2}, Lcom/openfeint/internal/request/OrderedArgList;-><init>()V

    .line 96
    .local v2, args:Lcom/openfeint/internal/request/OrderedArgList;
    if-eqz p1, :cond_0

    .line 97
    const-string v1, "friends_leaderboard"

    const-string v3, "true"

    invoke-virtual {v2, v1, v3}, Lcom/openfeint/internal/request/OrderedArgList;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 99
    :cond_0
    new-instance v0, Lcom/openfeint/api/resource/Leaderboard$1;

    move-object v1, p0

    move v3, p1

    move-object v5, p2

    invoke-direct/range {v0 .. v5}, Lcom/openfeint/api/resource/Leaderboard$1;-><init>(Lcom/openfeint/api/resource/Leaderboard;Lcom/openfeint/internal/request/OrderedArgList;ZLjava/lang/String;Lcom/openfeint/api/resource/Leaderboard$GetScoresCB;)V

    .line 120
    .local v0, req:Lcom/openfeint/internal/request/JSONRequest;
    invoke-virtual {v0}, Lcom/openfeint/internal/request/JSONRequest;->launch()V

    .line 121
    return-void
.end method

.method public static list(Lcom/openfeint/api/resource/Leaderboard$ListCB;)V
    .locals 4
    .parameter "cb"

    .prologue
    .line 200
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "/xp/games/"

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {}, Lcom/openfeint/internal/OpenFeintInternal;->getInstance()Lcom/openfeint/internal/OpenFeintInternal;

    move-result-object v3

    invoke-virtual {v3}, Lcom/openfeint/internal/OpenFeintInternal;->getAppID()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "/leaderboards"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 201
    .local v0, path:Ljava/lang/String;
    new-instance v1, Lcom/openfeint/api/resource/Leaderboard$3;

    invoke-direct {v1, v0, p0}, Lcom/openfeint/api/resource/Leaderboard$3;-><init>(Ljava/lang/String;Lcom/openfeint/api/resource/Leaderboard$ListCB;)V

    .line 224
    .local v1, req:Lcom/openfeint/internal/request/JSONRequest;
    invoke-virtual {v1}, Lcom/openfeint/internal/request/JSONRequest;->launch()V

    .line 225
    return-void
.end method


# virtual methods
.method public getFriendScores(Lcom/openfeint/api/resource/Leaderboard$GetScoresCB;)V
    .locals 1
    .parameter "cb"

    .prologue
    .line 90
    const/4 v0, 0x1

    invoke-direct {p0, v0, p1}, Lcom/openfeint/api/resource/Leaderboard;->getScores(ZLcom/openfeint/api/resource/Leaderboard$GetScoresCB;)V

    .line 91
    return-void
.end method

.method public getScores(Lcom/openfeint/api/resource/Leaderboard$GetScoresCB;)V
    .locals 1
    .parameter "cb"

    .prologue
    .line 83
    const/4 v0, 0x0

    invoke-direct {p0, v0, p1}, Lcom/openfeint/api/resource/Leaderboard;->getScores(ZLcom/openfeint/api/resource/Leaderboard$GetScoresCB;)V

    .line 84
    return-void
.end method

.method public getUserScore(Lcom/openfeint/api/resource/User;Lcom/openfeint/api/resource/Leaderboard$GetUserScoreCB;)V
    .locals 5
    .parameter "forUser"
    .parameter "cb"

    .prologue
    .line 148
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "/xp/users/"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p1}, Lcom/openfeint/api/resource/User;->resourceID()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "/games/"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-static {}, Lcom/openfeint/internal/OpenFeintInternal;->getInstance()Lcom/openfeint/internal/OpenFeintInternal;

    move-result-object v4

    invoke-virtual {v4}, Lcom/openfeint/internal/OpenFeintInternal;->getAppID()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "/leaderboards/"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {p0}, Lcom/openfeint/api/resource/Leaderboard;->resourceID()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "/current_score"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 149
    .local v1, path:Ljava/lang/String;
    new-instance v0, Lcom/openfeint/internal/request/OrderedArgList;

    invoke-direct {v0}, Lcom/openfeint/internal/request/OrderedArgList;-><init>()V

    .line 151
    .local v0, args:Lcom/openfeint/internal/request/OrderedArgList;
    new-instance v2, Lcom/openfeint/api/resource/Leaderboard$2;

    invoke-direct {v2, p0, v0, v1, p2}, Lcom/openfeint/api/resource/Leaderboard$2;-><init>(Lcom/openfeint/api/resource/Leaderboard;Lcom/openfeint/internal/request/OrderedArgList;Ljava/lang/String;Lcom/openfeint/api/resource/Leaderboard$GetUserScoreCB;)V

    .line 177
    .local v2, req:Lcom/openfeint/internal/request/JSONRequest;
    invoke-virtual {v2}, Lcom/openfeint/internal/request/JSONRequest;->launch()V

    .line 178
    return-void
.end method
